/* color palette from <https://github.com/vuejs/theme> */
:root {
  --vt-c-white: #ffffff;
  --vt-c-white-soft: #f8f8f8;
  --vt-c-white-mute: #f2f2f2;

  --vt-c-black: #181818;
  --vt-c-black-soft: #222222;
  --vt-c-black-mute: #282828;

  --vt-c-indigo: #2c3e50;
  --vt-c-primary: #42b983;
  --vt-c-primary-dark: #369870;

  --vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
  --vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
  --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
  --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);

  --vt-c-text-light-1: var(--vt-c-indigo);
  --vt-c-text-light-2: rgba(60, 60, 60, 0.66);
  --vt-c-text-dark-1: var(--vt-c-white);
  --vt-c-text-dark-2: rgba(235, 235, 235, 0.64);

  --vt-c-shadow: 0 4px 24px rgba(60, 60, 60, 0.08);
  --vt-c-shadow-hover: 0 8px 32px rgba(60, 60, 60, 0.12);
  --vt-c-radius: 12px;
  --vt-c-radius-lg: 16px;
}

/* semantic color variables for this project */
:root {
  --color-background: var(--vt-c-white);
  --color-background-soft: var(--vt-c-white-soft);
  --color-background-mute: var(--vt-c-white-mute);

  --color-border: var(--vt-c-divider-light-2);
  --color-border-hover: var(--vt-c-divider-light-1);

  --color-heading: var(--vt-c-text-light-1);
  --color-text: var(--vt-c-text-light-1);

  --section-gap: 160px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: var(--vt-c-black);
    --color-background-soft: var(--vt-c-black-soft);
    --color-background-mute: var(--vt-c-black-mute);

    --color-border: var(--vt-c-divider-dark-2);
    --color-border-hover: var(--vt-c-divider-dark-1);

    --color-heading: var(--vt-c-text-dark-1);
    --color-text: var(--vt-c-text-dark-2);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  font-weight: normal;
}

body {
  min-height: 100vh;
  color: var(--color-text);
  background: var(--color-background);
  transition:
    color 0.5s,
    background-color 0.5s;
  line-height: 1.6;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    'Fira Sans',
    'Droid Sans',
    'Helvetica Neue',
    sans-serif;
  font-size: 15px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  font-size: 16px;
}
body {
  overflow-x: auto;
  box-sizing: border-box;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 主体块自适应 */
.trace-detail-page,
.product-info-block,
.company-info-block,
.company-photo-block,
.processing-info-block,
.animal-cert-block,
.health-info-block {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 16px;
}

@media (max-width: 900px) {
  .trace-detail-page,
  .product-info-block,
  .company-info-block,
  .company-photo-block,
  .processing-info-block,
  .animal-cert-block,
  .health-info-block {
    max-width: 100%;
    padding: 8px;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 14px;
  }
  .trace-detail-body {
    flex-direction: column;
    align-items: stretch;
  }
  .trace-detail-img {
    width: 100%;
    height: auto;
    margin: 0 0 16px 0;
  }
  .trace-detail-content {
    width: 100%;
  }
  .company-info-content-row {
    flex-direction: column;
    gap: 8px;
  }
  .company-info-content-left,
  .company-info-content-right {
    max-width: 100%;
    min-width: 0;
  }
  .company-photo-img,
  .animal-cert-img {
    width: 100%;
    max-width: 300px;
    height: auto;
  }
  .el-dialog {
    width: 95vw !important;
    min-width: 0 !important;
    max-width: 100vw !important;
  }
}

.el-table,
.company-photo-img-list,
.animal-cert-img-list {
  overflow-x: auto;
  display: block;
}

.el-form,
.el-form-item,
.el-input,
.el-select {
  width: 100%;
  box-sizing: border-box;
}

/* 全局通用样式 */
.card {
  background: var(--color-background);
  border-radius: var(--vt-c-radius-lg);
  box-shadow: var(--vt-c-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--vt-c-shadow-hover);
}

.btn-primary {
  background: var(--vt-c-primary);
  color: #fff;
  border: none;
  border-radius: var(--vt-c-radius);
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(66, 185, 131, 0.2);
}

.btn-primary:hover {
  background: var(--vt-c-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 185, 131, 0.3);
}

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-border);
}

.page-title {
  font-size: 2rem;
  font-weight: bold;
  color: var(--color-heading);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--vt-c-text-light-2);
}

/* 响应式工具类 */
@media (max-width: 768px) {
  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .page-title {
    font-size: 1.5rem;
  }
}